package com.hmall.cart;

import com.hmall.api.config.DefaultFeignConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@MapperScan("com.hmall.cart.mapper")
//开启openFeign,代理调用其他微服务
@EnableFeignClients(basePackages = "com.hmall.api.clients",//指定服务所在的包
defaultConfiguration = DefaultFeignConfig.class)//开启openFeign日志
@SpringBootApplication
public class CartApplication {
    public static void main(String[] args) {
        SpringApplication.run(CartApplication.class, args);
    }
    @Bean
    public RestTemplate restTemplate(){//RestTemplate工具有发送http请求的方法
        return new RestTemplate();
    }
}